%option noyywrap
%{ 
#include<string.h>
#include<stdlib.h>

int chars = 0;
int words = 0;
int lines = 0; 
%}
%%
[a-zA-Z]+ {words++;chars += strlen(yytext);}
\n { lines++; }
. { chars++; }
%%

int main(int argc,char * argv[]){
	if(argc >= 0){
		yyin = fopen(argv[1],"r");	
	}
	yylex();
	printf("chars = %d; words = %d;lines = %d.",chars,words,lines);
	return 0;
}
